/*
 * BasicRtpSocket.h
 *
 *  Created on: 2018年5月1日
 *      Author: chuanjiang.zh@qq.com
 */

#ifndef BASICRTPSOCKET_H_
#define BASICRTPSOCKET_H_

#include "RtpSocket.h"
#include "Socket.h"
#include "TCriticalSection.h"

namespace av
{

class BasicRtpSocket: public RtpSocket
{
public:
	BasicRtpSocket();
	virtual ~BasicRtpSocket();

	virtual bool setPeer(const char* ip, int port);

	virtual void setConnectionHandler(ConnectionHandler handler);

	virtual void setTimeout(int ms);

	virtual void setSsrc(uint32_t ssrc);

protected:
	void fireConnectionState(int state);

protected:
	ConnectionHandler	m_connectionHandler;
	comn::CriticalSection	m_cs;

	uint32_t    m_initTime;
	uint32_t	m_ssrc;
	uint16_t    m_seq;

	comn::SockAddr	m_peerAddr;

};


} /* namespace av */

#endif /* BASICRTPSOCKET_H_ */
